/*
package com.consume;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Component;

*/
/**
 * @author zhangbowen
 * @date 2019/3/25
 **//*

@Component
public class Consumer {
    @KafkaListener(id = "test", topics = "test_topic_1")
    @SendTo(value = "replies")
    private String consume(ConsumerRecord consumerRecord) {
        // while (true) {
        System.out.println(consumerRecord);
        // }
        //throw new Exception();
        return "消费者消费成功";
    }
      @KafkaListener(topics = "streams1")
    public void receive(ConsumerRecord<Integer, String> consumer) {
        System.out.println("topic:" + consumer.topic());
        System.out.println("partition:" + consumer.partition());
        System.out.println("offset:" + consumer.offset());
        System.out.println("key:" + consumer.key());
        System.out.println("value:" + consumer.value());
    }

    @KafkaListener(topics = "topic3")
    public void receive2(ConsumerRecord<Integer, String> consumer) {
        System.out.println("##################################");
        System.out.println("topic:" + consumer.topic());
        System.out.println("partition:" + consumer.partition());
        System.out.println("offset:" + consumer.offset());
        System.out.println("key:" + consumer.key());
        System.out.println("value:" + consumer.value());
    }
}
*/
